Pythonで学ぶ音声合成 Quick startをスクリプトで動かす
#Pythonで学ぶ音声合成
Jupyter Notebookの例
スクリプトにし、CPUでまず動かす
音声波形データの再生に #sounddevice を使う
https://r9y9.github.io/ttslearn/latest/notebooks/ch00_Quick-start.html#DNN音声合成-(第5章・第6章)
依存関係
ttslearn==0.2.2
numpy==1.21.5が入った
sounddevice==0.4.4
code:python
>> from ttslearn.dnntts import DNNTTS
>> dnntts_engine = DNNTTS()
The use of pre-trained models is permitted for non-commercial use only.
>> wav, sr = dnntts_engine.tts("あらゆる現実を、すべて自分のほうへねじ曲げたのだ。")
>> type(wav)
<class 'numpy.ndarray'>
>> type(sr) # sampling_rate
<class 'int'>
>> wav.shape
(61760,)
>> sr
16000
>> import sounddevice as sd
>> sd.play(wav, sr)
>> sd.wait()